<!--
  ~ Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
  ~
  ~ This program is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU General Public License as published by the Free
  ~ Software Foundation; either version 3 of the License, or (at your option)
  ~ any later version.
  ~ This program is distributed in the hope that it will be useful, but WITHOUT
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  ~ more details.
  ~
  ~ You should have received a copy of the GNU General Public License along
  ~ with this program; if not, see http://www.gnu.org/licenses/
  -->

<html>
<head>
    <title>Sentinel Toolbox Help - pconvert Usage</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="../../style.css">
</head>

<body bgcolor="#FFFFFF">

<table class="header">
    <tr class="header">
        <td class="header">&nbsp;
            Usage of the <code>pconvert</code> Tool</td>
        <td class="header" align="right"><a href="./SnapOverview.html"><img src="../../images/snap_header.jpg" border=0></a></td>
    </tr>
</table>

<h3>Introduction</h3>

<p><code>pconvert</code> is a command line tool which lets a user convert <a href="BeamDimapFormat.html">BEAM-DIMAP</a>,
    <a href="envisat-products/index.html">ENVISAT</a>/MERIS, <a href="envisat-products/index.html">ENVISAT</a>/AATSR,
    ERS/ATSR and <a href="envisat-products/index.html">ENVISAT</a>/ASAR products
    into <a href="BeamDimapFormat.html">BEAM-DIMAP</a> or HDF-5 product formats.
    The tool can also generate greyscale and RGB images in TIFF, JPEG, PNG and BMP
    image formats.</p>

<p>ENVI users probably might profit from the fact that they can directly open
    a product band's image with ENVI after the product has been converted to the
    <a href="BeamDimapFormat.html">BEAM-DIMAP</a> format.
</p>

<h3>Running pconvert</h3>

<p>For executing the pconvert tool there is an executable script file located in the <code>bin</code> directory
    of your Sentinel Toolbox installation directory. The file name is <code>pconvert.bat</code> for MS Windows, <code>pconvert</code> for Mac OS X and <code>
    pconvert.sh</code> for UNIX operating systems.</p>

<p><code>pconvert</code> is a command-line application and as such it is invoked from a console
    or shell. UNIX users usually know what a shell is, MS Windows
    users have to start either <code>command.exe</code> or <code>cmd.exe</code> in order to use <code>pconvert</code>.
</p>

<p><b>NOTE:</b> The Sentinel Toolbox installer does not automatically append the <code>bin</code> directory of
    the Sentinel Toolbox installation directory to the system's <code>PATH</code> environment variable. If
    you need to run <code>pconvert</code> from a directory other then <code>bin</code> you have to adjust
    the <code>PATH</code> variable by your own.
</p>


<h3>Examples</h3>

<p>The following examples assume that you
<ul>
    <li>have opened a shell or console window (on MS Windows either command.exe or cmd.exe)</li>
    <li>have copied a test product to your <code><i>$S3TBX-INSTALL-DIR$</i>/bin</code> directory
        (in the following examples referred to as <code>MER_RR__1P_TEST.N1</code> - a MERIS Level 1B
        product)</li>
    <li>and that you have changed the current working directory to be the <code>bin</code> directory.</li>
</ul>

<p></p>

<p><b><code>&gt;&nbsp;pconvert -f tif -b 7,5,2 MER_RR__1P_TEST.N1</code></b> &nbsp;
    <i>Creates a TIFF RGB image from the bands R=7, G=5, B=2 with the name <code>MER_RR__1P_TEST.N1.tif</code>
        which will be written into the current working directory. </i></p>

<p><b><code>&gt;&nbsp;pconvert -f jpg -r 512,512 -b 13 MER_RR__1P_TEST.N1</code></b>
    &nbsp; <i>Creates a JPEG greyscale image from band 13 with the name <code>MER_RR__1P_TEST.N1.jpg</code>.
    The image will have a maximum size of 512 x 512 pixels. </i></p>

<p><b><code>&gt;&nbsp;pconvert -f h5 MER_RR__1P_TEST.N1</code></b> &nbsp; <i>Converts
    the entire product into a single HDF-5 file with the name <code>MER_RR__1P_TEST.N1.h5</code>.
</i></p>

<p><b><code>&gt;&nbsp;pconvert -f tifp MER_RR__1P_TEST.N1</code></b> &nbsp; <i>Converts
    the entire product into a single GeoTIFF file with the name <code>MER_RR__1P_TEST.N1.tif</code>.
</i></p>

<p><b><code>&gt;&nbsp;pconvert MER_RR__1P_TEST.N1</code></b> &nbsp; <i>Converts
    the entire product into the MERIS/(A)ATSR Toolbox's standard <a href="BeamDimapFormat.html">BEAM-DIMAP</a>
    product format. The Sentinel Toolbox and the data processors will be able to open the output
    product directly. The output file will have the name <code>MER_RR__1P_TEST.N1.dim</code>.
    Additionally a directory <code>MER_RR__1P_TEST.N1.data</code> will be created.
    It includes the raw data for the product's geophysical tie-point grids and bands.
</i></p>


<h3>Usage</h3>

<p>The following usage text is the output of the <code>pconvert</code> tool if
    you call it without any arguments or if you specify the option <code>-?</code>.
</p>

<pre>
Usage: pconvert [&lt;options&gt;] &lt;file-1&gt; [&lt;file-2&gt; &lt;file-3&gt; ...]

  where the &lt;file-i&gt; are the input data products and &lt;options&gt;
  can be a combination of the following options:

  -f or --format &lt;ext&gt;
     Specifies output format and file extension,
     possible values for &lt;ext&gt; are
       For product conversion:
         dim  - <a href="BeamDimapFormat.html">BEAM-DIMAP</a> product format
         h5   - HDF5 product format
         tifp - GeoTIFF product format
       For image conversion:
         png  - Portable Network Graphics image format
         jpg  - JPEG image format
         tif  - GeoTIFF image format
         bmp  - Microsoft Bitmap image format
       Note:
         If image conversion is selected the product must at least
         contain three bands to create an image.
         If this is not the case, you must use one of the options -b or -p
         to define the image content.
     The default value is "-f dim"
  -b or --bands &lt;i&gt; or &lt;iR&gt;,&lt;iG&gt;,&lt;iB&gt; or &lt;i1&gt;,&lt;i2&gt;,&lt;i3&gt;,&lt;i4&gt;...
     Don't use this option in combination with option -p.
     Specifies indices of the bands to be exported as a comma separated
     index list, 1 (one) corresponds to the first band.
     For image output, the number of bands should be 1 (greyscale) or
     3 (RGB), the default value is "-b 8,5,2" (optimized for MERIS).
     For product output, the default value includes all bands.

  -p or --rgb-profile &lt;file-path&gt;
     Valid for greyscale or RGB image output only.
     Don't use this option in combination with option -b.
     Specifies the file path to a text file containing an mathematic
     band expression for each of the RGB channels.
     The syntax of the file is as follows:
         red = &lt;red-expression&gt;
         green = &lt;green-expression&gt;
         blue = &lt;blue-expression&gt;
     It is also possible to use r, g and b instead of red, green and blue.
     Empty lines and lines beginning with the '#' character are ignored.

  -s or --histo-skip &lt;lower&gt;,&lt;upper&gt;
     Valid for greyscale or RGB image output only.
     Specifies the amount of pixels in percent to be skipped from the
     lower resp. upper end of each of the histograms of the R,G and B
     channels. For image output, the default value is "-s 1.0,4.0"
     For product output, the option is ignored.

  -m or --histo-match &lt;algorithm&gt;
     Valid for greyscale or RGB image output only.
     Specifies the histogram matching algorithm to be applied.
     Possible values for &lt;algorithm&gt; are:
         off - no histogram matching
         equalize - force an equalized output histogram
         normalize - force a normalized output histogram
     the default value is "-m off".

  -c or --color-palette &lt;file-path&gt;
     Valid only for image output of a single band.
     Specifies the file path to a text file containing a colour
     palette definition.

  -n or --no-data-color &lt;red&gt;,&lt;green&gt;,&lt;blue&gt;[,&lt;alpha&gt;]
     Valid for greyscale or RGB image output only.
     Specifies the colour that should be used for the no-data layer.
     The alpha value is optional. All component values have to be between
     0 and 255. An alpha value of 255 means fully opaque and 0 means
     fully transparent.

  -r or --max-res &lt;x-res&gt;,&lt;y-res&gt;
     Specifies the maximum image output size in pixels, for example 512,512.
     By default, the full product scene size is taken.
     This option can't be combined with -H or -W

  -W or --width  &lt;width&gt;
     Forces the specified image output width in pixels, for example 512.
     The image aspect ratio will be preserved.
     This option can't be combined with -r or -H

  -H or --height  &lt;height&gt;
     Forces the specified image output height in pixels, for example 512.
     The image aspect ratio will be preserved.
     This option can't be combined with -r or -W

  -o or --outdir &lt;dir-path&gt;
     Specifies the output directory.
     The default value is the current working directory.

  -d or --debug
     Turns the debug mode on.

  -? or -h or --help
     Prints this usage help.

</pre>

<hr>

</body>
</html>

<!--page visited by UK-->
